﻿@model IEnumerable<BBICMS.Model.BSize>
@{
    ViewBag.Title = EntityNames.BSize;
    ViewBag.PageTitle = ViewBag.Title + "_内容";
}



<div class="panel panel-default">
    <header class="panel-heading">
        <div class="text-right">
            <a class="btn btn-primary" href="@Url.Action("AddBSize")"><i class="glyphicon glyphicon-plus"></i> @string.Format("{0}{1}", Buttons.Add, EntityNames.BSize)</a>
        </div>
    </header>

    <div class="table-responsive">
        <table class="table table-hover">
            <thead>
                <tr>

                    <th>
                        值
                    </th>

                    <th>
                        <span class="glyphicon glyphicon-user"></span> 发布者
                    </th>
                    <th>
                        <span class="glyphicon glyphicon-time"></span> 创建日期
                    </th>
                    <th>
                        操作
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr class="item-container">
                        <td>
                            @item.Value
                        </td>
                        <td>
                            @item.AddedBy
                        </td>


                        <td>@item.AddedDate.ToShortDateString()</td>
                        <td>
                            <a href="@Url.Action("EditBSize", new { Id = item.Id })" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i></a>
                            <a href="@Url.Action("DeleteBSize", new { Id = item.Id })" class="btn btn-xs btn-danger delete-item"><i class="glyphicon glyphicon-trash"></i></a>
                        </td>
                    </tr>
                }

            </tbody>

        </table>
    </div>
    <footer class="panel-footer"></footer>
</div>


<form id="anti-form" method="post">
    @Html.AntiForgeryToken()
</form>
<!-- end main container -->
@section footer {

    <script>

        $(function () {


            //删除数据
            $('.delete-item').click(function (e) {
                e.preventDefault();
                var url = $(this).attr('href'), that = $(this), title = '@string.Format("删除{0}",EntityNames.BSize)';

                bootbox.setLocale("zh_CN");

                bootbox.confirm("是否确定删除该项？", function (result) {
                    if (result) {
                        Common.DeleteItem(url, title, that);
                        }
                    });

                });

        });
    </script>

}